# EyeCandyTexture - Texture with rounded corners and reflection below
# Copyright (C) 2007 Lauri Taimila
# 
# Entertainer is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# Entertainer is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

__licence__ = "GPLv2"
__copyright__ = "2007, Lauri Taimila"
__author__ = "Lauri Taimila <lauri@taimila.com>"

import clutter
from frontend.gui.widgets.rounded_texture import RoundedTexture
from frontend.gui.widgets.reflection_texture import ReflectionTexture

class EyeCandyTexture(clutter.Group):
    """
    Just a simple wrapper class for RoundedTexture and ReflectionTexture.
    
    EyeCandyTexture is a texture with rounded corners and reflection below.
    """
    
    def __init__(self, pixbuf, width, height):
        """
        Initialize new eye candy texture
        @param imagefile: Absoulte path to PNG file
        """
        clutter.Group.__init__(self)
        round = RoundedTexture(pixbuf, width, height)
        reflection = ReflectionTexture(pixbuf, width, height, round_corners=True)
        reflection.set_position(0, height)
        round.show()
        reflection.show()
        self.add(round)
        self.add(reflection)